use ascii_table::{Align, AsciiTable};
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
struct Args {
    #[structopt(short = "f", long)]
    base_frequency: f64,

    #[structopt(short = "n", long, default_value = "5", help = "-n 2 or -n 5")]
    base_name: char,

    #[structopt(short = "d", long)]
    diameter: f64,

    #[structopt(
        long = "freqs",
        help = "e.g. -freqs \"586.0, 662.0, 736.0, 790.0, 879.0, 987.0, 1040.0, 1090.0\""
    )]
    frequencies: Option<String>,
}

fn main() {
    let args = Args::from_args();
    let data = dizi::compute_lengths(
        args.base_name,
        args.diameter,
        args.base_frequency,
        args.frequencies,
    );

    let table = AsciiTable::new(Align::Center, 100);
    table.print(data);
}
